package com.itic.appbase.framework.xcx.type;
/**
 * 小程序订单状态
 * @author enne
 *
 */
public enum OrderState {
	
	paying("0","待支付"),waitConfirm("1","等待商家接单"),sending("2","配送中"),confirm("3","确认收货"),judging("4","待评价"),orderClose("5","交易关闭"),orderFail("6","交易失败"),orderCancel("7","交易取消"),orderFinish("8","交易完成");
	private String state;
	private String name;
	OrderState(String state, String name) {
		this.state = state;
		this.name = name;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public static OrderState  getOrderState(String state) {
		OrderState OrderState =null;
		switch (state) {
			case "0":
				OrderState = OrderState.paying;
				break;
			case "1":
				OrderState = OrderState.waitConfirm	;	
				break;
			case "2":
				OrderState = OrderState.sending;
				break;
			case "3":
				OrderState = OrderState.confirm;
				break;
			case "4":
				OrderState = OrderState.judging;
				break;
			case "5":
				OrderState = OrderState.orderClose;
				break;
			case "6":
				OrderState = OrderState.orderFail;
				break;
			case "7":
				OrderState = OrderState.orderCancel;
				break;
			case "8":
				OrderState = OrderState.orderFinish;
				break;

		}
		return OrderState;
	}

}
